import 'package:json_annotation/json_annotation.dart';

part 'category_entity.g.dart';

@JsonSerializable()
class CategoryList {
  List<CategoryEntity>? categories;

  CategoryList({this.categories});

  factory CategoryList.fromJson(Map<String, dynamic> json) => _$CategoryListFromJson(json);

  Map<String, dynamic> toJson() => _$CategoryListToJson(this);
}

@JsonSerializable()
class CategoryEntity {
  String? picUrl;
  bool? deleted;
  String? keywords;
  String? addTime;
  String? level;
  int? sortOrder;
  String? name;
  int? pid;
  String? updateTime;
  int? id;
  String? iconUrl;
  String? desc;

  CategoryEntity({
    this.picUrl,
    this.deleted,
    this.keywords,
    this.addTime,
    this.level,
    this.sortOrder,
    this.name,
    this.pid,
    this.updateTime,
    this.id,
    this.iconUrl,
    this.desc,
  });

  factory CategoryEntity.fromJson(Map<String, dynamic> json) => _$CategoryEntityFromJson(json);

  Map<String, dynamic> toJson() => _$CategoryEntityToJson(this);
}